![]() |
StringToExtended |
||||
Header: | NumberFormatting.h | Carbon status: | Supported | |
Converts a string representation of a number into a floating-point number, using a NumFormatStringRec structure to specify how the input number string is formatted.
FormatStatus StringToExtended ( ConstStr255Param source, const NumFormatString *myCanonical, const NumberParts *partsTable, extended80 *x );
A Pascal string that contains the string representation of a number.
A pointer to the internal representation of the formatting information for numbers, as produced by the StringToFormatRec function.
A pointer to a structure, obtained from the tokens ('itl4') resource, that shows the correspondence between generic number part separators (tokens) and their localized version (for example, a thousand separator is a comma in the United States and a decimal point in France).
On output, contains a pointer to the 80-bit SANE representation of the floating-point number.
A value that denotes the confidence level for the conversion that it performed. The low byte of the FormatStatus value is of type FormatResultType. Be sure to cast the result of StringToExtended to a type FormatResultType before working with it.
StringToExtended returns an 80-bit, not a 96-bit, representation.
StringToExtended uses the internal representation of number formatting information that was created by a prior call to StringToFormatRec to parse the input number string. It uses the number parts table to determine the components of the number string that is being converted. StringToExtended parses the string and then converts the string to a simple form, stripping nondigits and replacing the decimal point before converting it into a floating-point number. If the input string does not match any of the patterns, then StringToExtended parses the string as well as it can and returns a confidence level result that indicates the parsing difficulties.
To obtain a handle to the number parts table from a tokens resource, use the GetIntlResourceTable function.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)